# requires --extra-vars="target='host1;host2;group etc' package='python-tahrir'"
#
# Alternatively, you could update a group of packages like
# --extra-vars="target='host1;host2' package='python-t*'"
#
# To update from testing, adjust as follow:
# --extra-vars="target='host1;host2' package='python-t*' testing=True"

- name: push packages out
  hosts: "{{ target }}"
  user: root

  vars:
    testing: False

  tasks:

  - name: clean all metadata {% if testing %}(with infrastructure-testing on){% endif %}
    command: yum clean all {% if testing %} --enablerepo=infrastructure-testing {% endif %}
    always_run: yes

  - name: yum update {{ package }} {% if testing %}(with infrastructure-testing on){% endif %}
    yum: name={{ package }} state=latest {% if testing %}enablerepo=infrastructure-testing{% endif %}
